#ifndef QTDBUSPROPERTIES_H
#define QTDBUSPROPERTIES_H

#include <qtdbusextrasglobal.h>

#include <QObject>
#include <QDBusContext>
#include <QDBusVariant>

class QtDBusObjectManager;
class QTDBUSEXTRAS_EXPORT QtDBusProperties : public QObject, public QDBusContext
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "org.freedesktop.DBus.Properties")
public:
    explicit QtDBusProperties(QtDBusObjectManager *parent = nullptr);
    static QVariantMap propertiesOf(const QObject *object);

public Q_SLOTS:
    QDBusVariant Get(const QString &interface, const QString &property);
    void Set(const QString &interface, const QString &property, const QDBusVariant &value);
    QVariantMap GetAll(const QString &interface);

Q_SIGNALS:
    void PropertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalids);

private:
    QObject *objectAt(const QString &interface) const;
};

#endif // QTDBUSPROPERTIES_H
